package com.sanzang.exception;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.servlet.ModelAndView;

import com.sanzang.vo.JsonResult;

@RestControllerAdvice
public class SysAjaxExceptionHandler {
	
	@ExceptionHandler(value =Exception.class )
	public JsonResult errorHandler(HttpServletRequest request,HttpServletResponse response,Exception ex) {
		ex.printStackTrace();
		JsonResult ret = new JsonResult(false,ex.getMessage());	
		return ret;
	}

}
